#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long LL;
const int N = 2e5 + 10;
int n;
LL a[N], b[N];
LL f[N];
LL s1[N], s2[N];
int main()
{
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> a[i] >> b[i];
		s1[i] = s1[i - 1] + a[i];
		s2[i] = s2[i - 1];
		s2[i] = max(s2[i], b[i]);
	}
	for (int i = n; i >= 1; i--) {
		f[i] = f[i + 1];
		f[i] = max(f[i], b[i]);
	}
	for (int i = 1; i <= n; i++) {
		LL w = s1[n] - a[i];
		LL h = max(f[i + 1], s2[i - 1]);
		//cout << "w==" << w << endl;
		//cout << "h==" << h << endl;
		cout << (LL)w * h << " ";
	}
	return 0;
}